package com.zlt.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.zlt.annotation.Column;
import com.zlt.annotation.Id;
import com.zlt.annotation.Table;

import javax.xml.crypto.Data;

//user账号表（商家，用户）
@Table(name = "user")
public class User {

    @Id(name = "user_id")
    private int uid;// 用户主键id

    @Column(name = "user_name")
    @JSONField
    private String name;// 用户名

    @Column
    @JSONField
    private String password;// 用户密码

    @Column
    @JSONField
    private String phone;// 用户电话

    @Column(name = "nickname")
    @JSONField
    private String nickName;// 用户昵称

    @Column
    @JSONField
    private String site;// 地址

    @Column
    @JSONField
    private int state;// 用户状态

    @Column
    @JSONField
    private double price;// 用户金额

    @Column(name = "createtime")
    @JSONField
    private Data createTime;// 创建时间

    @Column(name = "logintime")
    @JSONField
    private Data loginTime;// 登陆时间

    public User() {
    }

    public User(int uid, String name, String password, String phone, String nickName, String site, int state, double price, Data createTime, Data loginTime) {
        this.uid = uid;
        this.name = name;
        this.password = password;
        this.phone = phone;
        this.nickName = nickName;
        this.site = site;
        this.state = state;
        this.price = price;
        this.createTime = createTime;
        this.loginTime = loginTime;
    }

    public int getUid() {
        return uid;
    }

    public void setUid(int uid) {
        this.uid = uid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getSite() {
        return site;
    }

    public void setSite(String site) {
        this.site = site;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public Data getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Data createTime) {
        this.createTime = createTime;
    }

    public Data getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Data loginTime) {
        this.loginTime = loginTime;
    }

    @Override
    public String toString() {
        return "User{" +
                "uid=" + uid +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", phone='" + phone + '\'' +
                ", nickName='" + nickName + '\'' +
                ", site='" + site + '\'' +
                ", state=" + state +
                ", price=" + price +
                ", createTime=" + createTime +
                ", loginTime=" + loginTime +
                '}';
    }
}
